import request from '@/config/axios'

// 客户基础信息 VO
export interface BaseCustomerInfoVO {
  id: string // 客户信息ID
  customerName: string // 客户名称
  customerRemark: string // 客户备注
  customerCode: string // 客户代码
  orderNo: number // 显示顺序
  customerShortName: string // 客户简称
}

// 客户基础信息 API
export const BaseCustomerInfoApi = {
  // 查询客户基础信息分页
  getBaseCustomerInfoPage: async (params: any) => {
    return await request.get({ url: `/mes/base-customer-info/page`, params })
  },

  // 查询客户基础信息详情
  getBaseCustomerInfo: async (id: number) => {
    return await request.get({ url: `/mes/base-customer-info/get?id=` + id })
  },

  // 新增客户基础信息
  createBaseCustomerInfo: async (data: BaseCustomerInfoVO) => {
    return await request.post({ url: `/mes/base-customer-info/create`, data })
  },

  // 修改客户基础信息
  updateBaseCustomerInfo: async (data: BaseCustomerInfoVO) => {
    return await request.put({ url: `/mes/base-customer-info/update`, data })
  },

  // 删除客户基础信息
  deleteBaseCustomerInfo: async (id: number) => {
    return await request.delete({ url: `/mes/base-customer-info/delete?id=` + id })
  },

  // 导出客户基础信息 Excel
  exportBaseCustomerInfo: async (params) => {
    return await request.download({ url: `/mes/base-customer-info/export-excel`, params })
  },
}
